package cn.imvc.app.models;

import java.util.Collection;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.web.util.matcher.RequestMatcher;

import cn.imvc.app.entities.Orders;
import cn.imvc.data.domain.ViewRequest;

public interface OrdersModel {

	LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> getRequestMap();
	
	Page<Orders> find(ViewRequest viewRequest);
	
	Orders get(int id);

	Orders save(Orders orders);
	
	Orders update(Orders orders);

	void delete(int id);

	void deleteBatch(int[] ids);
	
	Page<Orders> findByState(Byte state,Integer memberId,PageRequest pageRequest);
	
	boolean updateAdminCancel(int id);
	
	List<Orders> findByState(Byte state);
	
	void updateRefundAmount(int refundAmount,int id);
	
	Orders updateConfirm(int id);
	
	void updateBatchConfirm(int[] ids);
	
	Page<Object[]> findPageObjects(ViewRequest viewRequest);
	
	boolean updateDoCancel(int id);
	
	Integer calculateFreightAmount(Orders order);

	void updateSystemCancelOrder(Orders order);

	List<Orders> findByStateAndCreatedAtLessThan(Byte value, Date date);
}
